feat: add Linux desktop launcher for dev builds#5076
Conversation
Adds tools/anki-dev.desktop with an ANKI_SRC placeholder and install instructions in README.md for XDG-compatible desktops (GNOME, KDE, etc.). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
GithubAnon0000
left a comment
There was a problem hiding this comment.
You wrote you
would like to be able to run and test the Anki frontend and backend as it would appear to a user when user installs the latest release
Why is an additional .desktop file needed? Anki already ships a .desktop file.
And for every place where you use ANKI_SRC, I know you said this:
ANKI_SRC placeholder
But what's the point if the placeholder needs to be manually edited in order to work?
| [Desktop Entry] | ||
| Name=Anki (dev) | ||
| Comment=Spaced repetition flashcard program | ||
| Exec=bash -c 'cd ANKI_SRC && just run' | ||
| Icon=ANKI_SRC/qt/aqt/data/qt/icons/anki.png | ||
| Terminal=false | ||
| Type=Application | ||
| Categories=Education; | ||
| StartupWMClass=anki |
There was a problem hiding this comment.
Even if an additional .desktop file would make sense (I don't see how), generating one with claude isn't advised. Just make a copy of the already existing file and update accordingly. Your version just causes inconcistencies.
| ## Linux Desktop Integration | ||
|
|
||
| On any Linux desktop that follows the [XDG spec](https://specifications.freedesktop.org/desktop-entry-spec/latest/) (GNOME, KDE, XFCE, Cinnamon, MATE, and others), you can install a launcher entry for the development build so it appears in your app grid and can be pinned to the dock. | ||
|
|
||
| ```bash | ||
| # From the repo root | ||
| sed "s|ANKI_SRC|$(pwd)|g" tools/anki-dev.desktop \ | ||
| > ~/.local/share/applications/anki-dev.desktop | ||
| update-desktop-database ~/.local/share/applications/ | ||
| ``` | ||
|
|
||
| Then open your app grid, search for **Anki (dev)**, right-click, and choose **Add to Favourites** (GNOME) or the equivalent for your desktop. | ||
|
|
There was a problem hiding this comment.
The current way anki is doing this is already integrated into the desktop.
Aside from that, I don't think we should be teaching people how to pin an icon. That differs for every OS and WM and could change with major versions of OSs or WMs.
| Name=Anki (dev) | ||
| Comment=Spaced repetition flashcard program | ||
| Exec=bash -c 'cd ANKI_SRC && just run' | ||
| Icon=ANKI_SRC/qt/aqt/data/qt/icons/anki.png |
There was a problem hiding this comment.
The icon at qt/aqt/data/qt/icons/anki.png isn't the desktop icon. And your image shows that your PR creates an inconsistency, because anki now has a settings icon in the app overview.
Adds tools/anki-dev.desktop with an ANKI_SRC placeholder and install instructions in README.md for XDG-compatible desktops (GNOME, KDE, etc.).
Linked issue (required)
Fixes #5075
Summary / motivation (required)
Adds
tools/anki-dev.desktopwith paramaterized ANKI_SRC path for configuration by developer/tester wishing to integrate a pre-release dev version of the Anki app with their Desktop for testing or daily use.Steps to reproduce (required, use N/A if not applicable)
N/A
How to test (required)
Compile with
just runand then follow the newly added instructions in updated README.md section### Linux Desktop Integration:Open your app grid, find Anki (dev), and launch, pinning it to your toolbar or right click and "Add to Favorites" to verify it launches correctly and is integrated with your particular XDG-compatible Linux Desktop. To verify live (--editable) install, add a new feature and recompile before launching and testing the "Anki (dev)" desktop app.
Checklist (minimum)
just checkDetails
Works as expected on Ubuntu 26.04:
After installing Anki (dev) with this Desktop file, and updating the Software Registry in Ubuntu 26.04 (see new README.md section), the Software Manager (
gnome-software) does not list Anki (dev) under the "Installed" tab, but rather the released "Anki" app which has not been installed. Clicking on that app redirects to the Install link for the Flatpack/release version.Before / after behavior (optional)
N/A
Risk / compatibility / migration (optional)
N/A (developer-only feature)
UI evidence (required for visual changes; otherwise N/A)
Scope